home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d3 / rettig.arc / TRSOURCE.EXE / PRNSTAT.ASM < prev    next >
Assembly Source File  |  1990-10-22  |  1KB  |  61 lines

  1. ; PRNSTAT.ASM
  2. ;
  3. ; by Ralph Davis, Leonard Zerman
  4. ;
  5. ; Placed in the public domain by Tom Rettig Associates, 10/22/1990.
  6. ;
  7.  
  8.          INCLUDE   EXTENDA.INC
  9.  
  10.          CLpublic  <PRNSTATUS>
  11.  
  12.          CLfunc  int  PRNSTATUS
  13.  
  14.          CLcode
  15. ;-----------------------------------------------------------------
  16. ;  SYNTAX:  PRNSTATUS()
  17. ;
  18. ;           Checks status of LPT1
  19. ;
  20. ; RETURNS:  0: Printer OK
  21. ;           1: Printer hooked up and off-line
  22. ;           2: Printer hooked up and turned off
  23. ;           3: Printer not hooked up or out of paper
  24. ;          -1: I can't tell
  25. ;
  26. ;
  27.           PUSH  DS
  28.           PUSH  ES
  29.           MOV   AH,2
  30.           XOR   DX,DX
  31.           INT   17H       ; Get printer status
  32.           CMP   AH,90H    ; Printer hooked up & OK?
  33.           JNE   PS2
  34.           MOV   AX,0      ; 
  35.           JMP   SHORT EXIT
  36. PS2:
  37.           CMP   AH,18H    ; Hooked up, off-line
  38.           JNE   PS3
  39.           MOV   AX,1
  40.           JMP   SHORT EXIT
  41. PS3:
  42.           CMP   AH,0F8H   ; Hooked up, turned off
  43.           JNE   PS4
  44.           MOV   AX,2
  45.           JMP   SHORT EXIT
  46. PS4:
  47.           CMP   AH,0B0H   ; Not hooked up or out of paper
  48.           JNE   PS5
  49.           MOV   AX,3
  50.           JMP   SHORT EXIT
  51. PS5:
  52.           MOV   AX,-1     ; Huh?
  53.           
  54. EXIT:
  55.           POP   ES
  56.           POP   DS
  57.           CLret AX
  58. ;******************************************
  59.           END
  60.  
  61.